package bairui.international.model.domain.jpa;

import com.lianjing.sh.model.uml.model.file.TBSuper_FileBase;

/**
 *
 * (商学院分类滚动图片)TB_CollegeCategoryRollImage
 *
 * @说明
 * <pre>

 * </pre>
 *
 * @see Help_TB_CollegeCategoryRollImage#inheritance() 继承体系信息
 *
 */
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate

@javax.persistence.Entity(name="t_collegeCategoryRollImage")
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@SuppressWarnings("serial")
@com.lianjing.sh.model.common.annotation.Comment("商学院分类滚动图片")
@com.lianjing.sh.processing.info.annotation.InfoComment("商学院分类滚动图片")
public class TB_CollegeCategoryRollImage
 extends TBSuper_FileBase
 implements 
	com.lianjing.sh.model.common.stardard.TableModel<Long>,
	com.sh_lianjing.state.HasStatable,
	java.io.Serializable

{

	
	
	/**
	 * 必须属性赋值接口
	 */
	public static interface MustProperties{
		/** 名称 */
		public String getName();
		/** 文档 */
		public String getFileUrl();
		/** 类型 */
		public String getType();
		/** 原名称 */
		public String getOriginalName();
		/** 大小 */
		public Double getSize();
		/** 状态 */
		public com.lianjing.sh.model.uml.model.status.State_UpDown getState();
		/** 商学院分类 */
		public bairui.international.model.domain.jpa.TB_CollegeCategory getCollegeCategory();
	}
	
	/**
	 * 为必须属性赋值
	 */
	public TB_CollegeCategoryRollImage properties(MustProperties properties) {
		this.setName(properties.getName());
		this.setFileUrl(properties.getFileUrl());
		this.setType(properties.getType());
		this.setOriginalName(properties.getOriginalName());
		this.setSize(properties.getSize());
		this.setState(properties.getState());
		this.setCollegeCategory(properties.getCollegeCategory());
		return this;
	}
	
	/**
	 *	必须属性构造函数
	 */
	public TB_CollegeCategoryRollImage(MustProperties properties) {
		this.properties(properties);
	}
	
	
	/**
	 * 可选单属性赋值接口
	 */
	public static interface OptionalSingleProperties{
		/** 标题 */
		public String getTitle();
		/** Url */
		public String getUrl();
	}
	
	/**
	 * 为可选单属性赋值
	 */
	public TB_CollegeCategoryRollImage properties(OptionalSingleProperties properties) {
		this.setTitle(properties.getTitle());
		this.setUrl(properties.getUrl());
		return this;
	}
	
	
	
	public TB_CollegeCategoryRollImage(MustProperties must, OptionalSingleProperties optionalSingle) {
		this.properties(must);
		this.properties(optionalSingle);
	}
	
	/**
	 * 仅当前必须属性赋值接口
	 */
	public static interface CurrentMustProperties{
		/** 状态 */
		public com.lianjing.sh.model.uml.model.status.State_UpDown getState();
		/** 商学院分类 */
		public bairui.international.model.domain.jpa.TB_CollegeCategory getCollegeCategory();
	}
	
	/**
	 * 为仅当前必须属性赋值
	 */
	public TB_CollegeCategoryRollImage properties(CurrentMustProperties properties) {
		this.setState(properties.getState());
		this.setCollegeCategory(properties.getCollegeCategory());
		return this;
	}
	
	/**
	 * 仅当前可选单属性赋值接口
	 */
	public static interface CurrentOptionalSingleProperties{
		/** 标题 */
		public String getTitle();
		/** Url */
		public String getUrl();
	}
	
	/**
	 * 为仅当前可选单属性赋值
	 */
	public TB_CollegeCategoryRollImage properties(CurrentOptionalSingleProperties properties) {
		this.setTitle(properties.getTitle());
		this.setUrl(properties.getUrl());
		return this;
	}
	
	public TB_CollegeCategoryRollImage(
		@lombok.NonNull com.lianjing.sh.model.uml.model.file.TBSuper_FileBase bean,
		CurrentMustProperties mustProperties,
		CurrentOptionalSingleProperties optionalProperties
	) {
		this(bean);
		this.properties(mustProperties);
		this.properties(optionalProperties);
	}
	
	public TB_CollegeCategoryRollImage(
		@lombok.NonNull com.lianjing.sh.model.uml.model.file.TBSuper_FileBase bean
	) {
		update(bean);
	}
	
	public TB_CollegeCategoryRollImage update(com.lianjing.sh.model.uml.model.file.TBSuper_FileBase bean){
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setName(bean.getName());
		this.setFileUrl(bean.getFileUrl());
		this.setType(bean.getType());
		this.setOriginalName(bean.getOriginalName());
		this.setSize(bean.getSize());
		return this;
	}
	
	
	/**
	 * 更新属性内部类
	 */
	public abstract class UpdateProperties {
	
		public UpdateProperties() throws Exception {
			Integer orderValue = getOrderValue(TB_CollegeCategoryRollImage.this);
			if(isOverride_getOrderValue){
				TB_CollegeCategoryRollImage.this.setOrderValue(orderValue);
			}
	
			String name = getName(TB_CollegeCategoryRollImage.this);
			if(isOverride_getName){
				TB_CollegeCategoryRollImage.this.setName(name);
			}
	
			String fileUrl = getFileUrl(TB_CollegeCategoryRollImage.this);
			if(isOverride_getFileUrl){
				TB_CollegeCategoryRollImage.this.setFileUrl(fileUrl);
			}
	
			String type = getType(TB_CollegeCategoryRollImage.this);
			if(isOverride_getType){
				TB_CollegeCategoryRollImage.this.setType(type);
			}
	
			String originalName = getOriginalName(TB_CollegeCategoryRollImage.this);
			if(isOverride_getOriginalName){
				TB_CollegeCategoryRollImage.this.setOriginalName(originalName);
			}
	
			Double size = getSize(TB_CollegeCategoryRollImage.this);
			if(isOverride_getSize){
				TB_CollegeCategoryRollImage.this.setSize(size);
			}
	
			com.lianjing.sh.model.uml.model.status.State_UpDown state = getState(TB_CollegeCategoryRollImage.this);
			if(isOverride_getState){
				TB_CollegeCategoryRollImage.this.setState(state);
			}
	
			bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory = getCollegeCategory(TB_CollegeCategoryRollImage.this);
			if(isOverride_getCollegeCategory){
				TB_CollegeCategoryRollImage.this.setCollegeCategory(collegeCategory);
			}
	
			String title = getTitle(TB_CollegeCategoryRollImage.this);
			if(isOverride_getTitle){
				TB_CollegeCategoryRollImage.this.setTitle(title);
			}
	
			String url = getUrl(TB_CollegeCategoryRollImage.this);
			if(isOverride_getUrl){
				TB_CollegeCategoryRollImage.this.setUrl(url);
			}
		}
	
		public TB_CollegeCategoryRollImage up(){
			return TB_CollegeCategoryRollImage.this;
		}
	
		/** 排序值 */
		private boolean isOverride_getOrderValue = true;
		public Integer getOrderValue(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getOrderValue = false; 
			return null;
		}
		/** 名称 */
		private boolean isOverride_getName = true;
		public String getName(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getName = false; 
			return null;
		}
		/** 文档 */
		private boolean isOverride_getFileUrl = true;
		public String getFileUrl(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getFileUrl = false; 
			return null;
		}
		/** 类型 */
		private boolean isOverride_getType = true;
		public String getType(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getType = false; 
			return null;
		}
		/** 原名称 */
		private boolean isOverride_getOriginalName = true;
		public String getOriginalName(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getOriginalName = false; 
			return null;
		}
		/** 大小 */
		private boolean isOverride_getSize = true;
		public Double getSize(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getSize = false; 
			return null;
		}
		/** 状态 */
		private boolean isOverride_getState = true;
		public com.lianjing.sh.model.uml.model.status.State_UpDown getState(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getState = false; 
			return null;
		}
		/** 商学院分类 */
		private boolean isOverride_getCollegeCategory = true;
		public bairui.international.model.domain.jpa.TB_CollegeCategory getCollegeCategory(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getCollegeCategory = false; 
			return null;
		}
		/** 标题 */
		private boolean isOverride_getTitle = true;
		public String getTitle(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getTitle = false; 
			return null;
		}
		/** Url */
		private boolean isOverride_getUrl = true;
		public String getUrl(TB_CollegeCategoryRollImage it) throws Exception { 
			isOverride_getUrl = false; 
			return null;
		}
	
	}
	
	
	/**
	 * 构造函数
	 */
	public TB_CollegeCategoryRollImage() {
	}
	
	public TB_CollegeCategoryRollImage(
		@lombok.NonNull Long id
	) {
		this.setId(id);
	}
	
	public TB_CollegeCategoryRollImage(
		@lombok.NonNull TB_CollegeCategoryRollImage bean
	) {
		this.setId(bean.getId());
		this.setCreateTime(bean.getCreateTime());
		this.setModifyTime(bean.getModifyTime());
		this.setOrderValue(bean.getOrderValue());
		this.setName(bean.getName());
		this.setFileUrl(bean.getFileUrl());
		this.setType(bean.getType());
		this.setOriginalName(bean.getOriginalName());
		this.setSize(bean.getSize());
		this.setState(bean.getState());
		this.setCollegeCategory(bean.getCollegeCategory());
		this.setCreator(bean.getCreator());
		this.setLastModifier(bean.getLastModifier());
		this.setTitle(bean.getTitle());
		this.setUrl(bean.getUrl());
	}
	
	

	


	/**
	 * 属性
	 */
	@com.lianjing.sh.model.common.annotation.Comment("状态")
	@com.lianjing.sh.processing.info.annotation.InfoComment("状态")
	@javax.persistence.Enumerated(javax.persistence.EnumType.STRING)
	@javax.persistence.Column(name="state", nullable=false)
	private com.lianjing.sh.model.uml.model.status.State_UpDown state;

	@com.lianjing.sh.model.common.annotation.Comment("商学院分类")
	@com.lianjing.sh.processing.info.annotation.InfoComment("商学院分类")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory;

	@com.lianjing.sh.model.common.annotation.Comment("创建者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("创建者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="creator_id", nullable=false)
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_Admin creator;

	@com.lianjing.sh.model.common.annotation.Comment("最后修改者")
	@com.lianjing.sh.processing.info.annotation.InfoComment("最后修改者")
	@com.querydsl.core.annotations.QueryInit("*.*.*")
	@javax.persistence.JoinColumn(name="lastModifier_id", nullable=false)
	@javax.persistence.ManyToOne(optional=false)
	private bairui.international.model.domain.jpa.TB_Admin lastModifier;

	@com.lianjing.sh.model.common.annotation.Comment("标题")
	@com.lianjing.sh.processing.info.annotation.InfoComment("标题")
	@javax.persistence.Column(name="title", length=100)
	private String title;

	@com.lianjing.sh.model.common.annotation.Comment("Url")
	@com.lianjing.sh.processing.info.annotation.InfoComment("Url")
	@javax.persistence.Column(name="url", length=255)
	private String url;

	/** get[状态] */
	public com.lianjing.sh.model.uml.model.status.State_UpDown getState() {
		return this.state;
	}

	/** get[商学院分类] */
	public bairui.international.model.domain.jpa.TB_CollegeCategory getCollegeCategory() {
		return this.collegeCategory;
	}

	/** get[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin getCreator() {
		return this.creator;
	}

	/** get[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin getLastModifier() {
		return this.lastModifier;
	}

	/** get[标题] */
	public String getTitle() {
		return this.title;
	}

	/** get[Url] */
	public String getUrl() {
		return this.url;
	}

	/** set[状态] */
	public void setState(com.lianjing.sh.model.uml.model.status.State_UpDown state) {
		this.state = state;
	}

	/** set[商学院分类] */
	public void setCollegeCategory(bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory) {
		this.collegeCategory = collegeCategory;
	}

	/** set[创建者] */
	public void setCreator(bairui.international.model.domain.jpa.TB_Admin creator) {
		this.creator = creator;
	}

	/** set[最后修改者] */
	public void setLastModifier(bairui.international.model.domain.jpa.TB_Admin lastModifier) {
		this.lastModifier = lastModifier;
	}

	/** set[标题] */
	public void setTitle(String title) {
		this.title = title;
	}

	/** set[Url] */
	public void setUrl(String url) {
		this.url = url;
	}

	public void assignCollegeCategory(bairui.international.model.domain.jpa.TB_CollegeCategory collegeCategory) {
		if(null != collegeCategory){
			collegeCategory.addCollegeCategoryRollImages(this);
		}
		this.setCollegeCategory(collegeCategory);
	}
	



	
	
	

	/** take[商学院分类] */
	public bairui.international.model.domain.jpa.TB_CollegeCategory takeCollegeCategory(){
		if(null == this.collegeCategory){
			this.collegeCategory = new bairui.international.model.domain.jpa.TB_CollegeCategory();
		}
		return this.collegeCategory;
	}
	
	/** take[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin takeCreator(){
		if(null == this.creator){
			this.creator = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.creator;
	}
	
	/** take[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin takeLastModifier(){
		if(null == this.lastModifier){
			this.lastModifier = new bairui.international.model.domain.jpa.TB_Admin();
		}
		return this.lastModifier;
	}
	
	/** must[商学院分类] */
	public bairui.international.model.domain.jpa.TB_CollegeCategory mustCollegeCategory() {
		return this.collegeCategory;
	}
	
	/** must[创建者] */
	public bairui.international.model.domain.jpa.TB_Admin mustCreator() {
		return this.creator;
	}
	
	/** must[最后修改者] */
	public bairui.international.model.domain.jpa.TB_Admin mustLastModifier() {
		return this.lastModifier;
	}
	
	

	/**
	 * 复写 hashCode
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		return prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
	}
	
	/**
	 * 复写 equals
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj){
			return true;
		}
		if (obj == null){
			return false;
		}
		if (getClass() != obj.getClass()){
			return false;
		}
		TB_CollegeCategoryRollImage other = (TB_CollegeCategoryRollImage) obj;
		if (this.getId() == null) {
			return false;
		} else if (!this.getId().equals(other.getId())){
			return false;
		}
		return true;
	}
	

	/**
	 * 用来覆盖toString()的输出
	 */
	@javax.persistence.Transient
	private String toString;
	
	public void setToString(String toString) {
		this.toString = toString;
	}
	
	/**
	 * 复写 toString
	 */
	@Override
	public String toString() {
		if(null != this.toString){
			return this.toString;
		}
		String name = this.getName();
		if(null != name){
			return String.valueOf(name);
		}
		return super.toString();
	}	

	@javax.persistence.PrePersist
	public void prePersist() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setCreateTime(new java.util.Date());
		this.setModifyTime(new java.util.Date());
		this.setCreator((bairui.international.model.domain.jpa.TB_Admin)user);
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}
	
	@javax.persistence.PreUpdate
	public void preUpdate() {
		com.lianjing.sh.web.security.authority.login.LoginUserInfo userInfo = com.lianjing.sh.web.security.authority.login.Util_Login.getInfo();
		Object user = null == userInfo ? null : userInfo.getUser();
		this.setModifyTime(new java.util.Date());
		this.setLastModifier((bairui.international.model.domain.jpa.TB_Admin)user);
	}

	/**
	 * 状态相关
	 */
	public com.lianjing.sh.model.uml.model.status.State_UpDown state(){
		return this.getState();
	}


}
